#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define MaxSize 100
typedef char Elemtype;
typedef struct LinkStackNode {
	Elemtype data;
	struct LinkStackNode* next;
}LSNode;
void Initstack(LSNode *& s) {
	s = (LSNode*)malloc(sizeof(LSNode));
	s->next = NULL;
}
void DestroyStack(LSNode*& s) {
	LSNode* pre = s, * p = s->next;
	while (p != NULL)
	{
		free(pre);
		pre = p;
		p = pre->next;
	}
}
bool IsEmpty(LSNode* s) {
	return (s->next == NULL);
}
void Push(LSNode*& s, Elemtype e) {
	LSNode* p;
	p = (LSNode *)malloc(sizeof(LSNode));
	p->data = 0;
	p->next = s->next;
	s->next = p;
}

bool Pop(LSNode*& s, Elemtype e) {
	LSNode* p;
	if (IsEmpty(s)) return false;
	p = s->next;
	e = p->data;
	s->next = p->next;
	free(p);
	return true;
}
bool GetPop(LSNode*& s, Elemtype e) {
	if (IsEmpty(s)) return false;
	e = s->next->data;
	return true;
}
bool Match(char exp[], int n) {
	int i = 0;
	Elemtype e;
	bool match = true;
	LSNode* st;
	Initstack(st);
	while (i < n && match) {
		if (exp[i] == '(') Push(st, exp[i]);
		else if(exp[i] == ')')
		{
			if (GetPop(st, e) == true) {
				if (e != '(') match = false;
				else Pop(st, e);
			}
			else match = false;
		}

		if (exp[i] == '[') Push(st, exp[i]);
		else if (exp[i] == ']')
		{
			if (GetPop(st, e) == true) {
				if (e != '[') match = false;
				else Pop(st, e);
			}
			else match = false;
		}

		if (exp[i] == '{') Push(st, exp[i]);
		else if (exp[i] == '}')
		{
			if (GetPop(st, e) == true) {
				if (e != '{') match = false;
				else Pop(st, e);
			}
			else match = false;
		}
	}
	if (!IsEmpty(st)) match = false;
	DestroyStack(st);
	return match;
}
int main() {
	int len;
	Elemtype str[MaxSize];
	scanf("%s", str);
	len = strlen(str);
	if (Match(str, len)) printf("yes\n");
	else printf("no\n");
	return 0;
}